/*
 * Progetto, a new java application 
 *
 * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
 * indicated by the @author tags or express copyright attribution
 * statements applied by the authors.  All third-party contributions are
 * distributed under license by Red Hat Inc.
 *
 * This copyrighted material is made available to anyone wishing to use, modify,
 * copy, or redistribute it subject to the terms and conditions of the GNU
 * Lesser General Public License, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this distribution; if not, write to:
 * Free Software Foundation, Inc.
 * 51 Rattazzi Street, Fifth Floor
 * Pomezia, RM  00040  Italy
 */
package com.jfootball.business.impl;

import java.util.List;

import org.directwebremoting.annotations.RemoteMethod;
import org.directwebremoting.annotations.RemoteProxy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jfootball.dao.NationDao;
import com.jfootball.domain.Nation;
import com.jfootball.service.NationService;

/**
 * @author C_ICTDNS
 *
 */
@Transactional(readOnly = true)
@Service("nationService")
@RemoteProxy(name = "nationService")
public class NationServiceImpl implements NationService
{
	
	private final NationDao nationDAO;

	@Autowired
	public NationServiceImpl(NationDao nationDAO) 
	{
		this.nationDAO = nationDAO;
	}	
	

	public void saveNation(Nation obj)
	{
		nationDAO.saveOrUpdateNation(obj);
	}
	

	public List<Nation> getNations()
	{
		return nationDAO.listNations();
	}
	
	@RemoteMethod
	public List<Nation> getNationsByContinent(Long continentId)
	{
		return nationDAO.listNationsByContinent(continentId);		
	}
	
	public List<Nation> getNationsTournament()
	{
		return nationDAO.listNationsTournament();
	}	
	

	public Nation getNationByID(Long nationId)
	{
		return nationDAO.getNationByID(nationId);
	}
	

	public void deleteNation(Long nationId)
	{
		nationDAO.deleteNation(nationId);
	}

	
}